<?php


namespace App\Api\Controllers;


use App\Api\Controllers\UploadController as file;
use App\Models\ProductSku;
use App\Models\ProductSpec;
use Illuminate\Http\Request;

class IndexController extends Controller
{
    //关于
    public function about()
    {
        $data = [
            '12321333333333333333333333'
        ];
        return $this->responseData($data);
    }

    public function uploads(Request $request)
    {
        if(!$request->imgs){
            return $this->responseFailed(参数错误);
        }

        $file = new file();
        $res = $file->uploadImage($request->file('imgs'));
        if(!$res['code']){
            return $this->responseFailed($res['msg']);
        }
        return $res;
    }

    public function test()
    {
        //ProductSpec::getSpecItem(1);
        ProductSku::getSkuMinPrice(5);
    }
}